Skip to content

feat(signer): merge internal and external signer containers #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ndungudedan
Copy link

Currently BDK stores signers in two separate SignersContainer instances - one for internal keychain and one for external. This separation is unnecessary since:

  1. Most signers can sign for both keychains
  2. Both containers are always called during signing
  3. The separation adds complexity without benefits

This change:

  • Adds an extend method to SignersContainer to support merging containers
  • Keeps a single signer container in Wallet

Closes #186

Notes to the reviewers

  • Looking for a concept ACK to validate that my approach is okay.
  • 3 tests fail with Incompatible change descriptor, from the export module. On further investigation, I see that the export node returns the change descriptor as a public key while the derived change descriptor is a private key. I am not sure why this is case and a second review would be great:
change_descriptor: Some("tr([73c5da0a/86'/0'/0']tprv8fMn4hSKPRC1oaCPqxDb1JWtgkpeiQvZhsr8W2xuy3GEMkzoArcAWTfJxYb6Wj8XNNDWEjfYKK4wGQXh3ZUXhDF2NcnsALpWTeSwarJt7Vc/1/*)")

export.change_descriptor(): Some("tr([73c5da0a/86'/0'/0']tpubDC3pD7UZXnsgh3EBjbtBQiB1FnLask7UHBSunZ1DPK4dCFFZoFRkgxHB8gt42FvLzx1DpxfHWxAsYaY6b643RVcGjDxXxns7wKKYnnfEcbB/1/*)")

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo +nightly fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Currently BDK stores signers in two separate SignersContainer instances - one for
internal keychain and one for external. This separation is unnecessary since:
1. Most signers can sign for both keychains
2. Both containers are always called during signing
3. The separation adds complexity without benefits

This change:
- Adds an `extend` method to SignersContainer to support merging containers
- Keeps a single signer container in Wallet

Closes bitcoindevkit#186
@oleonardolima
Copy link
Contributor

Thanks for working on this one, though, for the next breaking change release (v3.0), the plan is to remove the signers altogether from the Wallet API, see #70 and #235. That said, it supersedes the changes from this PR and issue #186, as it's also a breaking change.

@ValuedMammal
Copy link
Collaborator

Thanks for your contribution. I agree with @oleonardolima, assuming we go ahead with #70, then this issue probably won't be as relevant.

@ndungudedan
Copy link
Author

Thanks! Closing the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

BDK should store signers in the same list
3 participants